package top.zymall.user.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.*;
import top.zymall.user.service.UserService;

/**
 * @Author: HouZeYu
 * @Description:
 * @Date: Created in 16:09 2019/7/10
 */
@RestController
public class UserController {
    @Autowired
    @Qualifier("userServiceImpl")
    private UserService userService;


    /***
     * 检验数据是否可用
     * @param param
     * @param type
     * @return
     */
    @GetMapping("/check/{param}/{type}")
    public Boolean checkUserData(@PathVariable("param")String param,@PathVariable(value = "type")Integer type){
      return userService.checkUserData(param,type);
    }

    /***
     * 发送短信验证码
     * @param phone
     */
    @PostMapping("send")
    public void sendVerify(@RequestParam("phone")String phone){
        userService.sendVerify(phone);
    }

}
